import request from './request'
import { useUserStore } from "../store/modules/user"
// 获取品牌列表
export function getBrandList(data: object) {
    let token = {
        'access-token': useUserStore().token
    }
    return request({
        url: '/goods/brand/getList',
        method: 'post',
        data,
        headers: token
    })
}

// 新增或修改品牌
export function saveBrand(data: object) {
    let token = {
        'access-token': useUserStore().token
    }
    return request({
        url: '/goods/brand/save',
        method: 'post',
        data,
        headers: token
    })
}

// 批量禁用或启用品牌
export function changeBrand(data: any, params: { status: boolean }) {
    let token = {
        'access-token': useUserStore().token
    }
    return request({
        url: '/goods/brand/',
        method: 'put',
        data,
        params,
        headers: token
    })
}

// 批量删除品牌
export function deleBrand(data: any) {
    let token = {
        'access-token': useUserStore().token
    }
    return request({
        url: '/goods/brand/',
        method: 'delete',
        data,
        headers: token
    })
}

// 查看品牌详细
export function getBrandDetail(id) {
    let token = {
        'access-token': useUserStore().token
    }
    return request({
        url: '/goods/brand/' + id,
        method: 'get',
        headers: token
    })
}